<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/CampsiteHouse.js此处编写
 -->
<template>
    <div>
        <view-grid
                   ref="grid"
                   :columns="columns"
                   :detail="detail"
                   :editFormFields="editFormFields"
                   :editFormFileds="editFormFields"
                   :editFormOptions="editFormOptions"
                   :searchFormFields="searchFormFields"
                   :searchFormFileds="searchFormFields"
                   :searchFormOptions="searchFormOptions"
                   :table="table"
                   :extend="extend">
        </view-grid>
    </div>
</template>

<script>
    import extend from "@/extension/mall/CampsiteHouse.js";
    import ViewGrid from "@/components/basic/ViewGrid.vue";
    var vueParam = {
        components: {
            ViewGrid
        },
        data() {
            return {
                table: {
                    key: 'id',
                    footer: "Foots",
                    cnName: '营房列表',
                    name: 'CampsiteHouse',
                    url: "/CampsiteHouse/",
                    sortName: "id"
                },
                sdh: [],
                extend: extend,
                editFormFields: {unitId: '',supplierCode: "","name":"","type":"","depositPrice":"","unLock":"","contact":"","contactPhone":"","area":"",prefix:"",openDate:"",num:"",area:"","creator": "", "createID": "", "createDate": "", "modifier": "", "modifyID": "", "modifyDate": "",},
                editFormOptions: [[
                                // { "dataKey": "mall_supplier", "data": [], "title": "供应商", "field": "supplierCode", "type": "select","required":true },
                                {"title":"营房名称","required":true,"field":"name","type":"like"},
                               {"title":"营房类型","required":true,"field":"type","type":"select",dataKey:'CampsiteHouseType',data: []},
                               {"title":"分区","field":"prefix","type":"text","required":true},],
                               [{"title":"单位列表","required":true,"field":"unitId","type":"select",dataKey:'',data: []},
                               { "title": "开放时间", "field": "openDate", "type": "datetime", "range": true },
                                ],
                              [
                               {"title":"开锁方式","field":"unLock","type":"select",dataKey:'unLock',data: [],hidden: false},
                              {"title":"总面积","field":"area","type":"text",hidden: false},
                              {"title":"押金","field":"depositPrice","type":"text", hidden: false},
                              ],
                              [{"title":"联系人","field":"contact","type":"text"},
                               {"title":"联系方式","field":"contactPhone","type":"text"},
                               {"title":"自动填充数量","field":"num","type":"text",hidden: true},
                            ]],
                searchFormFields: {"name":"","type":""},
                searchFormOptions: [[{"title":"营房名称","field":"name","type":"like"},{"title":"营房类型","field":"type","type":"select",dataKey:'CampsiteHouseType',data: []}]],
                columns: [
                        {field:'prefix',title:'分区前缀',type:'string',width:90,align:'left'},
                       {field:'type',title:'营房类型',type:'int',width:90,require:true,align:'left',bind: { key: 'CampsiteHouseType', data: [] }},
                       {field:'name',title:'营房名称',type:'string',width:150,require:true,align:'left'},
                       {field:'num',title:'总数量',type:'int',width:90,align:'left'},
                       {field:'area',title:'总面积',type:'string',width:90,align:'left',sortable:true},
                       {field:'contact',title:'联系人',type:'string',width:90,align:'left'},
                       {field:'contactPhone',title:'联系方式',type:'string',width:90,align:'left'},
                       {field:'openStartDate',title:'开放时间',type:'datetime',width:190,align:'left',sortable:true},
                       {field:'openEndDate',title:'开放截止时间',type:'datetime',width:190,align:'left',sortable:true},
                       {field:'creator',title:'创建人',type:'string',width:120,align:'left'},
                       {field:'createDate',title:'创建时间',type:'datetime',width:190,align:'left',sortable:true},
                       {field:'modifier',title:'修改人',type:'string',width:120,align:'left'},
                       {field:'modifyDate',title:'修改时间',type:'datetime',width:190,align:'left',sortable:true},
                       ],
                detail: {
                    cnName: "营位信息",
                    columns: [
                                // {field:'pics',title:'图片',type:'img',width:90,align:'left',edit: { type: 'img' }},
                                // {field:'name',title:'房名称',type:'string',width:90,align:'left',edit: { type: 'text' }},
                                {field:'code',title:'房编号',type:'string',width:90,align:'left',edit: { type: 'text',keep: true, required: true }},
                                {"field":"type","title":"营位类型","type":"select",edit: { type: 'select',keep: true, required: true },bind: { key: 'CampsiteHouseType', data: [] }},
                                {field:'houseType',title:'房型',type:'string',width:90,align:'left',edit: { type: 'selectZX',keep: true, required: true },bind: { key: '', data: [] }},
                                {"field":"unLock","title":"开锁方式","type":"select",edit: { type: 'select',keep: true, required: true },bind: { key: 'unLock', data: [] }},
                                {field:'area',title:'面积',type:'string',width:90,align:'left',edit: { type: 'text',keep: true, required: true }},
                                {field:'status',title:'状态',type:'int',width:90,align:'left',edit: { type: 'switch',keep: true, required: true }, data: ['待租','禁用'],disabled: true},
                                {field:'depositPrice',title:'押金',type:'int',width:90,align:'left',edit: { type: 'text',keep: true, required: true }},
                                {field:'bz',title:'备注',type:'int',width:90,align:'left',},
                            ],
                    sortName: "createDate",
                    key: "id",
                }
            };
        }
    };
    export default vueParam;
</script>
